/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * NewJFrame.java
 *
 * Created on Oct 27, 2010, 4:25:52 PM
 */

package components;

import java.awt.Color;
import java.awt.GridLayout;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.JRadioButton;

/**
 *
 * @author Sonia Tan
 */
public class NewJFrame extends javax.swing.JFrame {

    /** Creates new form NewJFrame */
    public NewJFrame() {
        initComponents();

        ButtonGroup test = new ButtonGroup();

        JRadioButton a = new JRadioButton();
        JRadioButton b = new JRadioButton();

        test.add(a);
        test.add(b);

        a.setText("a");
        b.setText("b");

        a.setLocation(1,1);
        b.setLocation(60,1);
        a.setSize(50,20);
        b.setSize(50,20);

        add(a);
        add(b);

        ButtonGroup test2 = new ButtonGroup();

        JRadioButton a2 = new JRadioButton();
        JRadioButton b2 = new JRadioButton();

        test2.add(a2);
        test2.add(b2);

        a2.setText("a");
        b2.setText("b");

        a2.setLocation(1,60);
        b2.setLocation(60,60);
        a2.setSize(50,20);
        b2.setSize(50,20);

        add(a2);
        add(b2);

        ButtonGroup test3 = new ButtonGroup();

        JRadioButton a3 = new JRadioButton();
        JRadioButton b3 = new JRadioButton();

        test3.add(a3);
        test3.add(b3);

        a3.setText("a");
        b3.setText("b");

        a3.setLocation(1,120);
        b3.setLocation(60,120);
        a3.setSize(50,20);
        b3.setSize(50,20);

        add(a3);
        add(b3);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new NewJFrame().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
